#!/usr/bin/env python
#_*_ coding:utf-8 _*_
'''
Created on 2016年6月2日
@author: liuhaozzu
'''
from django.http.response import HttpResponse


class MyMiddleWare(object):
    def process_request(self,request):
        print '1.process_request'
        print '404'
        remote_addr = request.META['REMOTE_ADDR']
        print remote_addr
        return HttpResponse(remote_addr)
        
    def process_view(self, request, callback, callback_args, callback_kwargs):
        print '1.process_view'
        
    def process_exception(self,request, exception):
        print '1.process_exception'
    def process_response(self, request, response):
        print '1.process_response'
        return response
class MyMiddleWare2(object):
    def process_request(self,request):
        print '2.process_request'
    def process_view(self, request, callback, callback_args, callback_kwargs):
        print '2.process_view'
        
    def process_exception(self,request, exception):
        print '2.process_exception'
    def process_response(self, request, response):
        print '2.process_response'
        return response